Translation:

3. We did test those before them and Allah will certainly know those who are true from those who are false.

Notes (Tafseer)

3424. The word "know" is used here more in the sense of testing than of acquiring knowledge. Allah is All-Knowing: He needs no test to increase His own knowledge, but the test is to burn out the dross within ourselves, as explained in the last note.